﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using System.Globalization;
using InformationSystem.BLL.Core.Service;
using InformationSystem.BLL.Core.Model;

namespace InformationSystem.WebSite.Module.AuthorityMgr
{
    public partial class Department : BasePage
    {
        public ICollegeService CollegeService;
        
        protected void Page_Load(object sender, EventArgs e)
        {           
            CollegeStore.DataSource = CollegeService.GetAllCollegeInfo();
            CollegeStore.DataBind();
        }
        protected void BeforeRecordUpdated(object sender, BeforeRecordUpdatedEventArgs e)
        {
            College college = e.Object<College>();
            CollegeService.UpdateCollegeInfo(college);
        }

        protected void AfterStoreChanged(object sender, AfterStoreChangedEventArgs e)
        {
            CollegeStore.DataSource = CollegeService.GetAllCollegeInfo();
            CollegeStore.DataBind();
            this.CollegeStore.RefreshAfterSaving = RefreshAfterSavingMode.Always;
        }

        protected override bool CommitPermissionCheck()
        {
            throw new NotImplementedException();
        }
    }
}